package com.axzhengxin.platform.business.mapper;

import com.axzhengxin.platform.business.domain.BizApplyInfo;
import com.axzhengxin.platform.business.domain.BizApproveInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 授信信息Mapper接口
 *
 * @author axzhengxin
 * @date 2021-02-23
 */
public interface BizApproveInfoMapper {

    /**
     * 依据综合授信记录ID删除综合授信数据
     *
     * @param approveDetailId 综合授信记录ID
     * @return 授信信息实体
     */
    BizApproveInfo deleteBizApproveInfoById(String approveDetailId);

    /**
     * 根据业务申请编号查询相关授信信息
     *
     * @param bizApplyInfo 取业务申请编号
     * @return 授信信息
     */
    List<BizApproveInfo> selectBizApproveInfoByReqId(BizApplyInfo bizApplyInfo);


    /**
     * 去重
     * @param uuid
     * @return
     */
    int checkApproveContractNo(@Param(value = "uuid") String uuid);


    /**
     * 新增
     * @param bizApproveInfo
     * @return
     */
    int insertBizApproveInfo(BizApproveInfo bizApproveInfo);

    /**
     * 查询
     * @param approveId
     * @return
     */
    BizApproveInfo selectBizApproveInfoByApproveId(@Param(value = "approveId") String approveId);

    /**
     * 修改授信总额
     * @param map
     * @return
     */
    int updateAmountByApproveId(Map<String,Object> map);

    /**
     * 判断是否首贷
     * @param currentDeptId
     * @param reqId
     * @return
     */
    int checkFirstLoan(@Param(value = "deptId") String currentDeptId,@Param(value = "reqId") String reqId);

    /**
     * 删除授信时 修改授信金额
     * @param map1
     */
    void updateAmountByApproveIdPlus(Map<String, Object> map1);
}
